package com.cool.utils;

import com.cool.common.CommonResult;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Objects;

/**
 * 响应工具类
 *
 * @author Jiangmanman
 * @date 2020/07/24
 */
public class ResponseUtil {

    public static boolean whetherItIsAJAX(HttpServletRequest request){

        String ajax = request.getHeader("X-Requested-With");
        return !Objects.isNull(ajax) && Objects.equals(ajax.trim(), ajax);
    }
}
